package haochu.com.qipai_adr.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.zhy.autolayout.AutoRelativeLayout;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import haochu.com.qipai_adr.R;

/**
 * 登录
 */
public class LoginActivity extends BaseActivity {

    @BindView(R.id.agreement)
    AutoRelativeLayout agreement;
    @BindView(R.id.check)
    ImageView check;
    // check按钮的显示和隐藏
    boolean checkToggle = false;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.ahoi_login);
        ButterKnife.bind(this);
    }

    @OnClick({R.id.agreement, R.id.button_yk})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.agreement:
                if (!checkToggle) {
                    check.setVisibility(View.VISIBLE);
                    checkToggle = true;
                } else {
                    check.setVisibility(View.GONE);
                    checkToggle = false;
                }
                break;
            case R.id.button_yk:
                startActivity(new Intent(LoginActivity.this, RoomActivity.class));
                break;
        }
    }
}
